package erfgame.core.world.terrain.file;

import java.io.File;


import erfgame.core.entity.AbstractEntity;
import erfgame.core.entity.Entity;
import erfgame.core.world.World;

public class EntityFileObjectDAO extends
        GenericFileObjectDAO<Long, Entity> {
    
    private World world;
    
    public EntityFileObjectDAO(FileStreamFactory streamFactory, Serializer<Entity> serializer, File directory, String extension, World world ) {
        super(streamFactory, serializer, directory, extension);
        this.world = world;
    }

    @Override
    public Entity retrieveObject(Long key) {
        Entity entity = super.retrieveObject(key);
        ((AbstractEntity)entity).setWorld(world);
        return entity;
    }

 
}
